package com.wiscamp.ninechapters.accounts.infrastructure.po;

import com.wiscamp.ninechapters.ddd.PersistenceObject;
import jakarta.persistence.*;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 账号批次快照
 */
@Data
@jakarta.persistence.Entity
@Table(name = "account_batch_snapshot")
public class AccountBatchSnapshotPO implements PersistenceObject {
    private static final long serialVersionUID = 1L;

    /**
     * 自动编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", insertable = false, nullable = false)
    private long id = 0;

    /**
     * 账户编号
     */
    @Column(name = "account_id", nullable = false)
    private long accountId = 0;

    /**
     * 账户类型
     */
    @Column(name = "account_type", nullable = false)
    private int accountType = 0;

    /**
     * 用户编号
     */
    @Column(name = "user_id", nullable = false)
    private long userId = 0;

    /**
     * 余额
     */
    @Column(name = "balance", nullable = false)
    private BigDecimal balance = new BigDecimal(0);

    /**
     * 批次号
     */
    @Column(name = "batch_number", nullable = false)
    private String batchNumber = "";

    /**
     * 创建时间
     */
    @Column(name = "created_time", nullable = false)
    private LocalDateTime createTime;

    /**
     * 变更时间
     */
    @Column(name = "modified_time", nullable = false)
    private LocalDateTime editTime;

    /**
     * 快照时间
     */
    @Column(name = "snapshot_time", nullable = false)
    private LocalDateTime snapshotTime;


}